<?php
class Helpmodel extends Model {

    function Helpmodel()
    {
        // Call the Model constructor
        parent::Model();
		
		$this->load->database();

    }
	
	function getIndice()
	{		
		$query = $this->db->get('indice');
		
		$indices = array();
		
		foreach ($query->result() as $row)
		{
			$indices[$row->idindice_2][$row->idindice]['titulo'] = $row->titulo;
		}
		
		return($indices);
	}
	
	function getConteudo($id)
	{
		$query = $this->db->get_where('conteudo', array('idindice'=>$id));
		$array = array();
		$array = $query->result();
		
		return $array[0];
	}
}